import { createRouter, createWebHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/Main",
      name: "Main",
      component: () => import("../views/Main.vue"),
      children: [
        {
          path: "/home",
          name: "home",
          component: HomeView,
        },
        {
          path: "/about",
          name: "about",
          component: () => import("../views/AboutView.vue"),
        },
        {
          path: "/ShowAccount",
          name: "ShowAccount",
          component: () => import("../views/Account/ShowAccount.vue"),
        },
        {
          path: "/ShowRole",
          name: "ShowRole",
          component: () => import("../views/Role/ShowRole.vue"),
        },

        {
          path: "/ShowMenu",
          name: "ShowMenu",
          component: () => import("../views/Menu/ShowMenu.vue"),
        },
        {
          path: "/ShowRoleMenu",
          name: "ShowRoleMenu",
          component: () => import("../views/RoleMenu/ShowRoleMenu.vue"),
        },
        {
          path: "/ShowRequest",
          name: "ShowRequest",
          component: () => import("../views/Request/ShowRequest.vue"),
        },
        {
          path: "/ShowReport",
          name: "ShowReport",
          component: () => import("../views/Request/ShowReport.vue"),
        },
      ],
    },
    {
      path: "/",
      name: "Login",
      component: () => import("../views/Account/Login.vue"),
    },
    {
      path: "/CityXian",
      name: "CityXian",
      component: () => import("../views/CityXian.vue"),
    },
    {
      path: "/ShowTraceability",
      name: "ShowTraceability",
      component: () => import("../views/TraceabilityApp/ShowTraceability.vue"),
    },
    {
      path: "/ShowXQ",
      name: "ShowXQ",
      component: () => import("../views/TraceabilityApp/ShowXQ.vue"),
    },
  ],
});

export default router;
